﻿<%@ Page Language="C#" MasterPageFile="~/INFTUR.master" AutoEventWireup="true" CodeBehind="ManterPacote.aspx.cs" Inherits="INFTUR.ManterPacote" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="principal" style="width:400px">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="consulta" style="width:400px">
        
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="odsPacote">
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                    <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                    <asp:BoundField DataField="DataInicio" HeaderText="DataInicio" 
                        SortExpression="DataInicio" />
                    <asp:BoundField DataField="DataFim" HeaderText="DataFim" 
                        SortExpression="DataFim" />
                    <asp:BoundField DataField="Preco" HeaderText="Preco" SortExpression="Preco" />
                    <asp:BoundField DataField="Hotel" HeaderText="Hotel" SortExpression="Hotel" />
                    <asp:TemplateField HeaderText="Atualizar">
                        <AlternatingItemTemplate>
                            Nome
                        </AlternatingItemTemplate>
                        <EditItemTemplate>
                            DataInicio
                        </EditItemTemplate>
                        <FooterTemplate>
                            Preco
                        </FooterTemplate>
                        <HeaderTemplate>
                            DataFim
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remover">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Remover</asp:LinkButton>
                            <cc1:ConfirmButtonExtender ID="LinkButton1_ConfirmButtonExtender" 
                                runat="server" ConfirmText="Deseja excluir?" Enabled="True" 
                                TargetControlID="LinkButton1">
                            </cc1:ConfirmButtonExtender>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            .<asp:ObjectDataSource ID="odsPacote" runat="server" 
                DataObjectTypeName="Negocios.PacoteBO" DeleteMethod="remover" 
                InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="consultarTodos" TypeName="Negocios.PacoteBOMetodos" 
                UpdateMethod="atualizar"></asp:ObjectDataSource>
        
        </div>
        
        <div id="cadastro" class="divDados" style="width:400px">
        
            <table class="style1">
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label1" runat="server" Text="ID:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbID" runat="server" Enabled="False"></asp:TextBox>
                        <asp:Button ID="Button1" runat="server" Text="Novo Pacote" 
                            onclick="Button1_Click" />
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label2" runat="server" Text="Nome:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbNome" runat="server" MaxLength="100" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label3" runat="server" Text="Descrição:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbDescricao" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label4" runat="server" Text="Data Inicial:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbDataIni" runat="server" style="margin-left: 0px" 
                            Enabled="False"></asp:TextBox>
                        <cc1:CalendarExtender ID="tbDataIni_CalendarExtender" runat="server" 
                            Enabled="True" TargetControlID="tbDataIni">
                        </cc1:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label5" runat="server" Text="Data Final:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbDataFim" runat="server" Enabled="False"></asp:TextBox>
                        <cc1:CalendarExtender ID="tbDataFim_CalendarExtender" runat="server" 
                            Enabled="True" TargetControlID="tbDataFim">
                        </cc1:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label6" runat="server" Text="Hotel:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="dlHotel" runat="server" Enabled="False" 
                            AppendDataBoundItems="True" DataSourceID="ObjectDataSource1" 
                            DataTextField="Nome" DataValueField="Id">
                            <asp:ListItem Value="0">Selecione Hotel</asp:ListItem>
                        </asp:DropDownList>
                        <br />
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                            DataObjectTypeName="Negocios.HotelBO" DeleteMethod="remover" 
                            InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="ConsultaTodos" TypeName="Negocios.HotelBOMetodos" 
                            UpdateMethod="atualizar">
                            <DeleteParameters>
                                <asp:Parameter Name="id" Type="Int32" />
                            </DeleteParameters>
                        </asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label7" runat="server" Text="Destino:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="dlDestino" runat="server" Enabled="False" 
                            AppendDataBoundItems="True" DataSourceID="ObjectDataSource2" 
                            DataTextField="tx_nome" DataValueField="nr_id">
                            <asp:ListItem Value="0">Selecione Destino</asp:ListItem>
                        </asp:DropDownList>
                        <br />
                        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                            DeleteMethod="Delete" InsertMethod="Insert" 
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
                            TypeName="Dados.INFTURDataSetTableAdapters.T_DESTINOTableAdapter" 
                            UpdateMethod="Update">
                            <DeleteParameters>
                                <asp:Parameter Name="Original_nr_id" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="tx_nome" Type="String" />
                                <asp:Parameter Name="tx_aeroporto" Type="String" />
                                <asp:Parameter Name="tx_lingua" Type="String" />
                                <asp:Parameter Name="tx_pais" Type="String" />
                                <asp:Parameter Name="tx_moeda" Type="String" />
                                <asp:Parameter Name="bo_visto" Type="Boolean" />
                                <asp:Parameter Name="Original_nr_id" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="tx_nome" Type="String" />
                                <asp:Parameter Name="tx_aeroporto" Type="String" />
                                <asp:Parameter Name="tx_lingua" Type="String" />
                                <asp:Parameter Name="tx_pais" Type="String" />
                                <asp:Parameter Name="tx_moeda" Type="String" />
                                <asp:Parameter Name="bo_visto" Type="Boolean" />
                            </InsertParameters>
                        </asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label8" runat="server" Text="Preço:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbPreco" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="Label9" runat="server" Text="Parcelamento:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbParcelamento" runat="server" MaxLength="256" Enabled="False" 
                            TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style2" align="center" colspan="2">
                        <asp:Button ID="btGravar" runat="server" Text="Gravar" Enabled="False" 
                            onclick="btGravar_Click" />
                        <cc1:ConfirmButtonExtender ID="btGravar_ConfirmButtonExtender" runat="server" 
                            ConfirmText="Confirmar ?" Enabled="True" TargetControlID="btGravar">
                        </cc1:ConfirmButtonExtender>
                        &nbsp;<asp:Button ID="btCancelar" runat="server" Text="Cancelar" 
                            Enabled="False" onclick="btCancelar_Click" />
                    </td>
                </tr>
            </table>
        
        </div>
    <asp:Label ID="lbErro" runat="server"></asp:Label>
        
    </div>
</asp:Content>